//card.cpp
/********************************************************************************
*																				*
*	Author:			Vanessa Starkey												*
*	Assignment:		Assignment 8												*
*	Class:			CPS-151														*
*	Instructor:		V. Starkley													*
*	Due Date:		November 7													*
*																				*
*	This file implements the card class.										*
*																				*
********************************************************************************/


#include "card.h"

Card::Card() {}

Card::Card(Suit s, Value v)
{
	theSuit = s;
	theValue = v;
}

Suit Card::getSuit()
{
	return theSuit;
}


Value Card::getValue()
{
	return theValue;
}

bool Card::operator ==(const Card& c)
{
	return (theValue == c.theValue && theSuit == c.theSuit);
}

bool Card::operator !=(const Card& c)
{
	return (theValue != c.theValue || theSuit != c.theSuit);
}

ostream& operator << (ostream& fout, const Card& c)
{

	switch (c.theValue)
	{
   		case 14:
      		fout << "Ace ";
			break;
		case 11:
      		fout << "Jack ";
			break;
		case 12:
      		fout << "Queen ";
			break;
		case 13:
      		fout << "King ";
			break;
		default:
      		fout << c.theValue << " ";
	}
	switch (c.theSuit)
	{
   		case C:
      		fout << char(5);
			break;
		case D:
      		fout << char(4);
			break;
		case H:
      		fout << char(3);
			break;
		case S:
      		fout << char(6);
			break;
	}
	return fout;
}
